From: Matthias Clasen Date: Sat, 18 Mar 2023 02:28:27 +0000 (-0400) Subject: gsk: Avoid reuploading textures too much X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~59^2^2~533^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8aa095c4d729351162869f977880e6317a46ea84;p=gtk4.git gsk: Avoid reuploading textures too much When filtering changes for an already-cached texture, we need to clear the render data before setting the new one, otherwise it does not take and we end up reuploading the texture every frame. --- diff --git a/gsk/gl/gskgldriver.c b/gsk/gl/gskgldriver.c index af3d8e3b93..39b987a9cd 100644 --- a/gsk/gl/gskgldriver.c +++ b/gsk/gl/gskgldriver.c @@ -777,6 +777,8 @@ gsk_gl_driver_load_texture (GskGLDriver *self, g_hash_table_insert (self->textures, GUINT_TO_POINTER (texture_id), t); + gdk_texture_clear_render_data (texture); + if (gdk_texture_set_render_data (texture, self, t, gsk_gl_texture_destroyed)) t->user = texture;